<template>
  <div class="app-container">
    <el-row>
      <el-button type="success" @click="dialogVisible = true">添加</el-button>
    </el-row>
    <el-table
      :data="Gld"
      style="width: 100%"
    >
      <el-table-column
        prop="mc"
        label="隔离点名称"
      />
      <el-table-column
        prop="wz"
        label="位置"
      />
      <el-table-column
        prop="fjs"
        label="房间数"
      />
      <el-table-column
        prop="gzrysl"
        label="工作人员数量"
      />
      <el-table-column
        prop="glrl"
        label="隔离容量"
      />
      <el-table-column
        prop="glrysl"
        label="隔离人员数量"
      />
      <el-table-column
        prop="ID"
        label="操作"
      >
        <template slot-scope="scope">
          <el-button type="danger" size="small" @click="del(scope.row.id)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-dialog
      title="隔离数据"
      :visible.sync="dialogVisible"
      width="50%"
    >
      <el-form ref="form" style="margin-top: 20px;" :model="Gld_form" label-width="180px">
        <el-form-item label="隔离点名称">
          <el-input v-model="Gld_form.mc" />
        </el-form-item>
        <el-form-item label="位置">
          <el-input v-model="Gld_form.wz" />
        </el-form-item>
        <el-form-item label="房间数">
          <el-input v-model="Gld_form.fjs" />
        </el-form-item>
        <el-form-item label="工作人员数量">
          <el-input v-model="Gld_form.gzrysl" />
        </el-form-item>
        <el-form-item label="隔离容量">
          <el-input v-model="Gld_form.glrl" />
        </el-form-item>
        <el-form-item label="隔离人员数量">
          <el-input v-model="Gld_form.glrysl" />
        </el-form-item>
      </el-form>
      <div style="text-align: center;width: 100%">
        <el-button type="primary" @click="onSubmit">确定</el-button>
        <el-button @click=" dialogVisible = false">取消</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
export default {
  name: 'GgjcxxForm',
  data() {
    return {
      dialogVisible: false,
      Gld: [],
      Gld_form: {
        mc: '',
        wz: '',
        fjs: 0,
        gzrysl: '',
        glrl: '',
        glrysl: ''
      }
    }
  },
  methods: {
    onSubmit() {
      console.log('提交')
    },
    del(id) {
      this.$alert('确认删除该记录吗？', '提示', {
        confirmButtonText: '确定',
        callback: action => {
          this.$message.success('删除成功！')
        }
      })
      console.log(id)
    }
  }
}
</script>

<style scoped>

</style>
